<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PSAdmin.Core.Domain.PSScript>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Script Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%=Model.Name%></h2>

    <div class="scriptdetails">    
        <div class="description">
            <%= Html.Encode(Model.Description) %>
        </div>
        
        <%= Html.ValidationSummary()%>

        <%int i = 0;%>
        <%using (Html.BeginForm("Details", "Script", new { id = Model.Id })) { %>
            <fieldset>
                <legend>Script Variables</legend>
                <%foreach (var variable in Model.Variables)
                  { %>
                    <p>
                        <%=Html.Hidden("variables[" + i + "].key", variable.Id)%>
                        <label><%=Html.Encode(variable.Name) %></label>
                        <%=Html.TextBox("variables[" + i + "].value")%> 
                        &nbsp;<%=Html.Encode(variable.Description) %>
                    </p>
                <%i++;%>
                <%} %>
                <p>
                    <input type="submit" value="Execute" />
                </p>
            </fieldset>
        <%} %>
    </div>
</asp:Content>

